//
//  UserNoticeViewController.m
//  WanCaiC8
//
//  Created by QiuXun on 2018/10/11.
//  Copyright © 2018 tangang. All rights reserved.
//

#import "UserNoticeViewController.h"

@interface UserNoticeViewController ()

@end

@implementation UserNoticeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    self.title = @"关于";
    self.view.backgroundColor = [UIColor whiteColor];

    [self setupUI];
    
}

//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//
//    [self dismissViewControllerAnimated:YES completion:nil];
//
//}




-(void)iconClick{
    
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"https://9369.cc"]];
    
}
-(void)setupUI{
    
    UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon-icon"]];
    
    [self.view addSubview:icon];
    
//    icon.userInteractionEnabled = YES;
//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(iconClick)];
//    [icon addGestureRecognizer:tap];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.view).offset(80);
        make.size.mas_equalTo(CGSizeMake(80, 80));
    }];
    
    icon.layer.cornerRadius = 10;
    icon.layer.masksToBounds = YES;
    
    
    UILabel *title = [[UILabel alloc] init];
    title.textAlignment = NSTextAlignmentCenter;
    title.font = [UIFont boldSystemFontOfSize:20];
    title.text = @"盈彩网客户端";
    [self.view addSubview:title];
    [title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(icon);
        make.top.equalTo(icon.mas_bottom).offset(18);
    }];
    
    
    UILabel *versionLabel = [[UILabel alloc] init];
    versionLabel.textColor= DEFAULTLINECOLOR;
    versionLabel.textAlignment = NSTextAlignmentCenter;
    versionLabel.font = [UIFont systemFontOfSize:14];
    
    


    // 获取App的版本号
    versionLabel.text = [NSString
                         stringWithFormat:@"Version: %@",VERSION];
    
    [self.view addSubview:versionLabel];
    
    [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(title);
        make.top.equalTo(title.mas_bottom).offset(8);
    }];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
